package world;

import math.MathUtil;
import math.Vector3f;

public class ChunkPosition {
	public final int x;
	public final int y;
	public final int z;

	public ChunkPosition(int par1, int par2, int par3) {
		this.x = par1;
		this.y = par2;
		this.z = par3;
	}

	public ChunkPosition(Vector3f par1Vec3) {
		this(MathUtil.floor(par1Vec3.x), MathUtil.floor(par1Vec3.y), MathUtil.floor(par1Vec3.z));
	}

	public boolean equals(Object obj) {
		if (!(obj instanceof ChunkPosition)) {
			return false;
		} else {
			ChunkPosition chunkposition = (ChunkPosition) obj;
			return chunkposition.x == this.x && chunkposition.y == this.y && chunkposition.z == this.z;
		}
	}

	public int hashCode() {
		return this.x * 8976890 + this.y * 981131 + this.z;
	}
}
